<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   xmlns:f="http://xmlns.jcp.org/jsf/core"
   xmlns:h="http://xmlns.jcp.org/jsf/html"
   xmlns:p="http://primefaces.org/ui"
   xmlns:pe="http://primefaces.org/ui/extensions"
   xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
   template="/WEB-INF/templates/default.xhtml">
   
   	<f:metadata>
	   	<f:viewParam name="tradeRuleId" value="#{tradeRuleHome.id}"></f:viewParam>
	   	<f:event listener="#{tradeRuleHome.initConversation()}" type="preRenderView"></f:event>
	   	<f:viewParam name="moduleName" value="交易规则管理"></f:viewParam>
   	</f:metadata>
   
   	<ui:define name="content">
   
		<h:form id="editForm">         
			<p:panel id="panel" header="#{tradeRuleHome.managed ? '修改' : '新增'}交易规则" style="margin-bottom:10px;">
		        <p:messages id="messages" closable="true">
		       		<p:autoUpdate />
		       	</p:messages>
		        
		        <h:panelGrid columns="2" cellpadding="5">
		        
					<p:outputLabel for="content" value="交易规则" />
					<pe:ckEditor id="content" value="#{tradeRuleHome.instance.content}" width="100%"></pe:ckEditor>
					<ui:remove>
						<p:editor	  id="content"
							   widgetVar="content"
								   value="#{tradeRuleHome.instance.content}"
							    required="true"
							      height="400">
						</p:editor>	   
					</ui:remove>
				</h:panelGrid>
			</p:panel>
			
			<p:commandButton action="#{tradeRuleHome.saveAndFlush()}" value="保存" ajax="false" />
			<p:commandButton value="删除" action="#{tradeRuleHome.delete()}">
				<p:confirm header="请确认" message="您确认删除记录吗?" icon="ui-icon-alert" />
			</p:commandButton>
			<p:commandButton action="#{tradeRuleHome.cancel()}" value="取消" immediate="true"></p:commandButton>	
						
			<p:confirmDialog id="confirmDialog" global="true" showEffect="fade" hideEffect="explode" widgetVar="confirmDialog">
			    <p:commandButton value="确认" styleClass="ui-confirmdialog-yes"></p:commandButton>
			    <p:commandButton value="取消" immediate="true" styleClass="ui-confirmdialog-no" />
			</p:confirmDialog>
		</h:form>
      
   	</ui:define>
</ui:composition>
